#ifndef __EPSILON_TESTBED__WINDOW_H__
#define __EPSILON_TESTBED__WINDOW_H__

class eWindow;
class e3dRenderContext;

#include "../Epsilon/window.h"
#include "../Epsilon/Epsilon3D/viewport.h"
#include "command.h" // eTB_iVariableListener

//
// NOTE: The following two procedures are only
//         implemented on Win32 for the time being.
//

/* Brings the Win32 console to the foreground... */
void eTB_BringConsoleToFront (void);

/* Brings the Win32 window, which eTB_RenderWindow
     is derived from to the foreground... */
void eTB_BringWindowToFront  (void);


/**
 * Wraps eWindow and e3dRenderContext to create a window
 *   suitable for OpenGL or Direct3D rendering.
 *
**/
class eTB_RenderWindow : public e_iWindowListener,
                         public eTB_iVariableListener
{
public:
           eTB_RenderWindow (void) {
    rc  = NULL;
    win = NULL;
  }

  virtual ~eTB_RenderWindow (void);

  bool OnResize  (eWindowRect& rect);
  void Create    (const TCHAR* name, int width, int height);
  void DrawFrame (void);

  /* If a state machine variable changes, this is where the window will
       be notified... */
  bool OnVarChange (eTB_Variable* var, void* val);

  void printf       (                 int x, int y, const TCHAR* szFormat, ...);
  void color_printf (DWORD fontColor, int x, int y, const TCHAR* szFormat, ...);

  void color_print  (DWORD fontColor, int x, int y, const TCHAR* szText, int length);

  /* Outline printing... (adds a black background around printed text... */
  void outline_printf (DWORD fontColor, int x, int y, const TCHAR* szFormat, ...);

public:
  eWindow*          win;
  e3dRenderContext* rc;
  e3dViewport       viewport;
};

#endif /* _EPSILON_TESTBED__WINDOW_H__ */
